<!--
 * @Author: HeAo
 * @Date: 2022-01-04 14:58:04
 * @LastEditTime: 2022-01-06 11:52:38
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \am-app\src\views\manager\OrderDetailsTwo.vue
 * 别乱动！
-->
<template>
  <div>
    <van-nav-bar
      title="工单详情"
      left-text="返回"
      left-arrow
      @click-left="$router.go(-1)"
    />
    <div class="content">
      <van-cell-group>
        <van-field v-model="order.type" label="工单类型" readonly />
        <van-field v-model="order.status" label="工单状态" readonly />
        <van-field v-model="order.engineer_id" label="项目名称" readonly />
        <van-field v-model="order.device_id" label="设备名称" readonly />
        <van-field
          v-model="order.bill_why"
          label="申报原因"
          value="暂无"
          readonly
        />
        <van-field name="image" label="申报图片" value="暂无" readonly />
        <div>
          <img
            v-for="(item, index) in order.begin_photos"
            :key="index"
            width="150px"
            :src="item"
            alt="暂无图片"
          />
        </div>
      </van-cell-group>
      <div style="margin-top: 20px"></div>
    </div>
  </div>
</template>
<script>
import { get } from "@/utils/request.js";
import { mapState } from "vuex";
import { Dialog, Notify } from "vant";
export default {
  data() {
    return {
      order: {},
      order_id: null,
    };
  },
  computed: {
    ...mapState("user", ["info"]),
  },
  methods: {
    // 加载当前用户的工单信息
    loadWorkOrder() {
      let url = "/workorder/pageQuery";
      // 绑定当前用户
      this.params.account_id = this.info.id;
      get(url, this.params).then((resp) => {
        this.workOrderData = resp.data;
      });
    },
  },

  created() {
    this.order_id = this.$route.query.id;
    // 执行根据id查询工单数据的方法

    this.loadWorkOrder();
  },
};
</script>
<style scoped>
.content {
  padding: 15px;
}
</style>
